Yep! It's a group match. Seeing the next there, it's probably in a loop. However, a better way of handling what you have there would be to use a conditional and test the regex: if ( $line =~ /^(\d+)\s/ ) { $paperAnnot{$1} = $line; } or eve